﻿#region Usings
using BK.Model;
using BK.Repositories.EF;
#endregion

namespace BK.InitialTestDataCreator
{
    internal class Program
    {
        #region Class Methods
        private static void Main()
        {
            SetupTestUsers();

            SetupImportStatuses();
        }

        private static void SetupImportStatuses()
        {
            ImportStatusesRepository importStatusesRepository = new ImportStatusesRepository(new BkDataContext());
            importStatusesRepository.DeleteAll();
            importStatusesRepository.Add(new ImportStatus(ImportStatuses.AlreadyImported));
            importStatusesRepository.Add(new ImportStatus(ImportStatuses.Fail));
            importStatusesRepository.Add(new ImportStatus(ImportStatuses.Successfull));
            importStatusesRepository.Save();
        }

        private static void SetupTestUsers()
        {
            UsersRepository usersRepository = new UsersRepository(new BkDataContext());
            usersRepository.DeleteAll();

            usersRepository.Add(new User
                {
                    FirstName = "Анатолій",
                    LastName = "Гринчук",
                    Email = "hrynchuk@gmail.com",
                    Password = "1234",
                    ConfirmPassword = "1234"
                });
            usersRepository.Add(new User
                {
                    FirstName = "Наталія",
                    LastName = "Гринчук",
                    Email = "natasha.hrynchuk@gmail.com",
                    Password = "1234",
                    ConfirmPassword = "1234"
                });
            usersRepository.Save();
        }
        #endregion
    }
}